/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package evocarcassonne.core.elements;

import evocarcassonne.core.board.Tile;

import java.util.HashSet;
import java.util.Set;

/**
 * @author pnaubourg
 */
public class Field extends Element {

    Set<City> cities = new HashSet();

    public Field(Tile tile) {
        super(tile, null);
    }

    public void addCity(City city) {
        cities.add(city);
    }


    public int evaluate() {
        int value = 0;

        for (City city : cities) {
            if (city.isComplete()) {
                value += 3;
            }
        }
        return value;
    }

}
